package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.CardsCategory;
import com.stlm2.dems.entity.CardsState;
import com.stlm2.dems.entity.CardsType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Author：fuchunyu
 * Date：2017/10/13
 * Description：
 */
public class BaseCards {
    private Integer id;
    private String name;
    private CardsType cardsType;
    private BigDecimal money;
    private Integer validDay;
    private Integer goodsId;
    private Integer goodsCategoryId;
    private CardsCategory cardsCategory;
    private Integer cardsState;
    private Date createTime;
    private Integer createUserId;

    public Integer getValidDay() {
        return validDay;
    }

    public void setValidDay(Integer validDay) {
        this.validDay = validDay;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getGoodsCategoryId() {
        return goodsCategoryId;
    }

    public void setGoodsCategoryId(Integer goodsCategoryId) {
        this.goodsCategoryId = goodsCategoryId;
    }

    public CardsCategory getCardsCategory() {
        return cardsCategory;
    }

    public void setCardsCategory(CardsCategory cardsCategory) {
        this.cardsCategory = cardsCategory;
    }

    public Integer getCardsState() {
        return cardsState;
    }

    public void setCardsState(Integer cardsState) {
        this.cardsState = cardsState;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Integer createUserId) {
        this.createUserId = createUserId;
    }

    public CardsType getCardsType() {
        return cardsType;
    }

    public Integer getCardsTypeValue() {
        return (cardsType != null) ? cardsType.getIntValue() : null;
    }

    public void setCardsTypeValue(Integer cardType) {
        if(cardType != null)
            cardsType = CardsType.getByIntValue(cardType);
    }

    public void setCardsType(CardsType cardsType) {
        this.cardsType = cardsType;
    }


    public Integer getCardsCategoryValue(){
        return (cardsCategory != null) ? cardsCategory.getIntValue() : null;
    }
    public void setCardsCategoryValue(Integer cardCategory){
        if(cardCategory != null)
            cardsCategory = CardsCategory.getByIntValue(cardCategory);
    }
}
